import styled from 'styled-components';

interface ContainerProps {
    $color: string;
}

export const Containerxx = styled.div<ContainerProps>`
    background-color: #0095dd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    margin: 0;
    position: relative; /* 为绝对定位的子元素提供参照 */

    h1 {
        font-size: 45px;
        color: white;
    }
    
    .btn {
        cursor: pointer;
        border: 0;
        padding: 10px 20px; /* 修正为正确的 padding 格式 */
        background-color: black;
        color: #fff;
        border-radius: 5px;
        margin: 5px; /* 添加按钮间距 */
    }
    
    /* 按钮动画效果 */
    .btn:focus {
        outline: 0;
    }
      
    .btn:hover {
        background: #222;
    }
      
    .btn:active {
        transform: scale(0.98);
    }
    
    .rule-btn {
        position: absolute;        
        top: 30px;
        left: 30px;
        width: 120px;
        height: 40px;
    }
    
    .show_rule {
        position: absolute;
        left: 0;
        top: 0;
        background: #333;
        color: #fff;
        width: 400px;
        min-height: 100vh;
        line-height: 1.5;
        padding: 20px;
        transform: translateX(-400px); 
        transition: transform 0.5s ease-in-out; /* 缩短过渡时间 */
        z-index: 1000; /* 确保覆盖其他元素 */
    }
    
    .show_rule.show {
        transform: translateX(0);
    }
    
    canvas {
        background: #f0f0f0;
        display: block;
        border-radius: 5px;
        margin-top: 20px; /* 添加画布上方间距 */
    }

    /* 登录按钮样式 */
    .login-container {
        position: absolute;
        top: 20px;
        right: 30px;
    }

    .dropdown {
        position: absolute;
        top: 50px;
        right: 0;
        background: #fff;
        color: #000;
        border: 1px solid #ccc;
        border-radius: 5px;
        width: 150px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        display: none;
        flex-direction: column;
        z-index: 1001;
    }

    .dropdown.show {
        display: flex;
    }

    .dropdown-item {
        padding: 10px;
        cursor: pointer;
        border-bottom: 1px solid #eee;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item:hover {
        background-color: #f5f5f5;
    }
`;